import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

interface IconItem {
  icon?: string
  children?: RouteRecordItem[]
}

export type RouteRecordItem = IconItem & RouteRecordRaw

// 展示对象均来自views
export const routes: Array<RouteRecordItem> = [
  {
    path: '/',
    name: 'home',
    icon: "home.svg",
    redirect: '/TerminalsView'
  },
  {
    path: '/TerminalsView',
    name: 'TerminalsView',
    icon: "info.svg",
    component: () => import(/* webpackChunkName: "TerminalsView" */ '@/views/TerminalsView.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
